<div class="row">
<?if(isset($system_message))echo $system_message;?>
	<?if(!empty($grade_level_section_data)):?>
	
	<form action="" method="POST" class="custom">
		<div class="row">
			<div class="large-6 columns">
				<?=!empty($levels) ? form_dropdown('i',$levels) : 'Please set Grade Levels';?>
			</div>
			<div class="large-6 columns">
				<div class="btn-group">
					<input type="submit"  class="btn" name="filter_sections" value="Filter Section">
				</div>
			</div>
		</div>
	</form>
	
	<div>
	<p class="lead-title">
		Sections <span class="btn-group">
		<a href="<?=site_url('rss-add-section');?>" class="btn btn-primary btn-mini"><i class="icon-plus"></i> Add Section</a>
		<a href="<?=site_url('room_section_subject/generate_all_schedules');?>" class="btn btn-success btn-mini confirm" title="This will generate all sections without schedule based on the subject in the curriculum. Please make sure that all curriculums has subjects. This may take a while, do you want to continue?" ><i class="icon-refresh"></i> Generate All Section Schedules</a>
		<!--<a href="<?=site_url('rss-add-section');?>" class="btn btn-mini"><i class="icon-print"></i>Print Class List</a></span></p>-->
	<table class="table table-stripped">	
		<tr class="info thead">
			<td>Section Name</td>
			<td>Grade Level Assigned:</td>
			<td>Section Adviser:</td>
			<td>Remaining Slot:</td>
			<td>Maximum Slot:</td>
			<td>&nbsp;</td>
		</tr>
		<tbody>
		<?foreach($grade_level_section_data as $gld):?>
			<tr>
				<td><?=$gld->section_name;?></td>
				<td><?=$gld->level_desc;?></td>
				<td><?=ucwords(strtolower($gld->advisers_name));?></td>
				<td><?=$gld->remaining_slot;?></td>
				<td><?=$gld->max_load;?></td>
				<td>
					<div class="btn-group">
					 <a href="<?=site_url('rss-section-detail').'/'.$gld->id;?>" class="btn btn-mini">Details
					 <a href="<?=site_url('rss-update-section').'/'.$gld->id;?>" class="confirm btn btn-mini">Edit</a>
				<?if($gld->section_status == 'active'):?>
					 <a href="<?=site_url('rss-section-schedule').'/'.$gld->id;?>" class="confirm btn btn-mini">Schedule</a>
					 <a href="<?=site_url('destroy-section').'/'.$gld->id;?>" class="confirm btn btn-mini">Destroy</a>
				<?elseif($gld->section_status == 'inactive'):?>
					 <a href="<?=site_url('restore-section').'/'.$gld->id;?>" class="confirm btn btn-mini">Restore</a>
				<?endif;?>
					</div>
				</td>
			</tr>
		<?endforeach;?>
		</tbody>
	</table>
		<?=$links;?>
	</div>
	<?else:?>
		<div>
			<legend>Warning!</legend>
			<div class="notice">No Items to display <a href="<?=site_url('rss-add-section');?>" class="add">Add Section</a></div>
		</div>
	<?endif;?>
	
</div>